package com.example.userservice.service;

import com.example.service.TokenService;
import com.example.userservice.dao.TokenDao;
import com.example.userservice.pojo.Token;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author zhouyp
 * @program example-parent
 * @description
 * @create 2020-07-27
 */
@Service
@org.apache.dubbo.config.annotation.Service
public class TokenServiceImpl implements TokenService {
	@Autowired
	private TokenDao tokenDao;

	@Override
	public String infoWithToken(String tokenStr) {
		Token token = tokenDao.findByToken(tokenStr);
		return null != token ? token.getEmail() : "";
	}
}
